<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./js/jquery-3.6.0.js"></script>
</head>
<body>
    <a href="http://www.baidu.com" title="点击跳转百度页面">百度</a>
    <input type="checkbox" checked>复选框
    <div index="1" data-index="2">我是div</div>
    <span>123</span>
    <script>
        $('span').data('uname', 'andy');
        console.log($('span').data('uname'));
        // $('span').attr('uname', 'sandy');
        $('span').data('obj', {name: 'andy', age: 19});
    </script>
</body>
</html>